/**
 * 搜索模块
 */
import request from '@/utils/request'

/**
 * 获取联想建议
 * @param {*} q 搜索关键词
 * @returns promise
 */
export const getSearchSuggestion = q => {
  return request({
    method: 'GET',
    url: '/v1_0/suggestion',
    params: { q }
  })
}

/**
 * 搜索结果
 * @param {Object} params { page, per_page, q}
 * @returns promise
 */
export const getSearchResult = params => {
  return request({
    method: 'GET',
    url: '/v1_0/search',
    params
  })
}
